package com.fjp.heartguard.viewmodel

import androidx.databinding.ObservableField
import androidx.lifecycle.MutableLiveData
import com.fjp.heartguard.app.base.HTBaseViewModel
import com.fjp.heartguard.app.data.bean.OlderList
import com.fjp.heartguard.app.data.bean.Reports
import com.fjp.heartguard.app.data.bean.ReportsType
import com.fjp.heartguard.app.network.HttpRequestCoroutine
import me.hgj.jetpackmvvm.ext.request
import me.hgj.jetpackmvvm.state.ResultState

/**
 *Author:Mr'x
 *Time:2025/1/19
 *Description:
 */
class ReportMineViewModel : HTBaseViewModel() {

    var olders = MutableLiveData<ResultState<OlderList>>()
    val keyword = ObservableField("")
    var pageSize = 20
    var page = 1

    fun getOlderList(){
        request({
            HttpRequestCoroutine.getOlderList(keyword.get()!!, page, pageSize, ReportsType.MINE.value)
        }, olders, false)
    }

}